package com.jia.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author 1038940655
 * @create 2021/1/13 20:22
 */
@Configuration
public class ConfigBean { //Cofiguration -- spring applicationContext.xml

//配置ribbon负载均衡来实现RestTemplate
    @LoadBalanced//Ribbon
    @Bean
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

}
